#ifndef IMAGEPREPROCESSINGSETTINGS_H
#define IMAGEPREPROCESSINGSETTINGS_H

#include <QDialog>
#include <QMouseEvent>

// 参数名称宏定义，使用大驼峰命名
#define PARAM_ENABLE_CROP "EnableCrop"
#define PARAM_TOP_LEFT "TopLeft"
#define PARAM_TOP_RIGHT "TopRight"
#define PARAM_BOTTOM_LEFT "BottomLeft"
#define PARAM_BOTTOM_RIGHT "BottomRight"
#define PARAM_ROTATION_ANGLE "RotationAngle"
#define PARAM_MIRROR_TYPE "MirrorType"
#define PARAM_MIRROR_TYPE_NAME "MirrorTypeName"

namespace Ui {
class ImagePreprocessingSettings;
}

class ImagePreprocessingSettings : public QDialog
{
    Q_OBJECT

public:
    explicit ImagePreprocessingSettings(QWidget *parent = nullptr);
    ~ImagePreprocessingSettings();
    
    /**
     * @brief 设置参数到UI控件
     * @param params 参数映射，使用QVariantMap作为万能变量类型
     */
    void setParameters(const QVariantMap &params);
    
    /**
     * @brief 从UI控件收集参数
     * @return 参数映射，使用QVariantMap作为万能变量类型
     */
    QVariantMap collectParameters() const;

private slots:
    /**
     * @brief 处理确定按钮点击事件
     */
    void onPushButtonOKClicked();
    
    /**
     * @brief 处理取消按钮点击事件
     */
    void onPushButtonCancelClicked();
    void on_checkBoxEnableCrop_toggled(bool checked);

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
private:
    bool isDragging;
    QPoint dragPosition;

private:
    Ui::ImagePreprocessingSettings *ui;
};

#endif // IMAGEPREPROCESSINGSETTINGS_H
